package net.zigin.nhi.could.waste.service.impl;

import net.zigin.commons.util.ParamsMapUtil;
import net.zigin.commons.util.ReflectUtil;
import net.zigin.nhi.could.waste.model.AreaCity;
import net.zigin.nhi.could.waste.vo.AreaCityVo;
import net.zigin.nhi.could.waste.vo.AreaTownVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import net.zigin.nhi.could.waste.dao.BaseMapper;
import net.zigin.nhi.could.waste.dao.AreaTownMapper;
import net.zigin.nhi.could.waste.model.AreaTown;
import net.zigin.nhi.could.waste.service.AreaTownService;

import java.util.List;

/*#################################################################*
# 说明:以下代码通过哲勤代码生成工具自动生成    
# 工具:GeneratorCode
# 作者:mgw1986                                                  
# 生成时间:2021-9-9 21:00:34                                               
##################################################################*/


/**
 *  AreaTown服务实现类
 * @ClassName: AreaTownServiceImpl
 * @author mgw1986
 * @date 2021-9-9 21:00:34
 * @version V1.0
 */
@Service
public class AreaTownServiceImpl extends AbstractServiceImpl<AreaTown, String> implements AreaTownService{
	@Autowired
	private AreaTownMapper areaTownMapper;

	@Override
	public BaseMapper<AreaTown, String> getMapper() {
		return areaTownMapper;
	}

	@Override
	public List<AreaTownVo> getListByRegionCode(String regionCode) {
		ParamsMapUtil.ParamMap<String, Object> paramMap = ParamsMapUtil.getInstance().addParam("regionCode", regionCode);
		List<AreaTown> areaTowns = areaTownMapper.selectListByCondition(paramMap);
		return ReflectUtil.copyProperties(areaTowns, AreaTownVo.class);
	}
}